<div class="module-coin">
    <ol class="breadcrumb">
        <li>网站维护</li>
        <li>币种列表</li>
    </ol>
    <div class="ui-box form-inline">
        <div class="body-title">参数配置
            <div class="alert alert-warning" role="alert">
                <p class="tip">功能开关说明：</p>
                <p class="tip">开启：前台展示该资产</p>
                <p class="tip">关闭：前台不展示该资产</p>
            </div>
        </div>
        <table class="table table-striped table-hover">
            <thead>
            <tr>
                <th width="5%" class="th">资产名称</th>
                <th width="12%" class="th">网络确认数</th>
                <th width="12%" class="th">充值开关</th>
                <th width="13%" class="th">提币（钱包）精度</th>
                <th width="15%" class="th">提币手续费</th>
                <th width="15%" class="th">提币最小额度</th>
                <th width="16%" class="th">提币最大额度</th>
                <th width="12%" class="th">功能开关</th>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in vm.coinListMap" ng-if="vm.isLoading === false">
                <td>{{item.assetCode}}</td>
                <td>
                    <span class="text" style="margin-right: 5px;">{{vm.coinListMap[item.assetCode][vm.config.ASSETCODECONFIRMNUM]}}</span>
                    <input type="number"
                           style="width: 60px;"
                           ng-model="vm.coinListMap[item.assetCode][vm.config.ASSETCODECONFIRMNUM + '_INPUT']"
                           class="form-control coin-input">
                    <a href="javascript:;"
                       ng-click="vm.update(item.assetCode, vm.config.ASSETCODECONFIRMNUM, vm.coinListMap[item.assetCode][vm.config.ASSETCODECONFIRMNUM + '_INPUT'])"
                       class="link">更新</a>
                </td>
                <td>
                    <span class="text" ng-if="vm.coinListMap[item.assetCode][vm.config.DEPOSITLEVEL_DEFAULT] === '-1'">关闭</span>
                    <span class="text" ng-if="vm.coinListMap[item.assetCode][vm.config.DEPOSITLEVEL_DEFAULT] === '0'">开启</span>
                    <span class="status-box" ng-if="vm.coinListMap[item.assetCode][vm.config.DEPOSITLEVEL_DEFAULT] === '-1'">
                        <a href="javascript:;"
                           ng-click="vm.updateDeposit(item.assetCode, '0', '开启')"
                           class="btn btn-success">开启</a>
                        <a href="javascript:;"
                           disabled
                           ng-click="vm.updateDeposit(item.assetCode, '-1', '关闭')"
                           class="btn btn-default">关闭</a>
                    </span>
                    <span class="status-box" ng-if="vm.coinListMap[item.assetCode][vm.config.DEPOSITLEVEL_DEFAULT] === '0'">
                        <a href="javascript:;"
                           disabled
                           ng-click="vm.updateDeposit(item.assetCode, '0', '开启')"
                           class="btn btn-success">开启</a>
                        <a href="javascript:;"
                           ng-click="vm.updateDeposit(item.assetCode, '-1', '关闭')"
                           class="btn btn-default">关闭</a>
                    </span>
                </td>
                <td>
                    <span class="text" style="margin-right: 5px;">{{vm.coinListMap[item.assetCode][vm.config.WITHDRAWPRECISION]}}</span>
                    <input type="number"
                           style="width: 60px;"
                           ng-model="vm.coinListMap[item.assetCode][vm.config.WITHDRAWPRECISION + '_INPUT']"
                           class="form-control coin-input">
                    <a href="javascript:;"
                       ng-click="vm.update(item.assetCode, vm.config.WITHDRAWPRECISION, vm.coinListMap[item.assetCode][vm.config.WITHDRAWPRECISION + '_INPUT'])"
                       class="link">更新</a>
                </td>
                <td>
                    <span class="text" style="margin-right: 5px;">{{vm.coinListMap[item.assetCode][vm.config.WITHDRAWMINFEE]}}</span>
                    <input type="number"
                           style="width: 80px;"
                           ng-model="vm.coinListMap[item.assetCode][vm.config.WITHDRAWMINFEE + '_INPUT']"
                           class="form-control coin-input">
                    <a href="javascript:;"
                       ng-click="vm.update(item.assetCode, vm.config.WITHDRAWMINFEE, vm.coinListMap[item.assetCode][vm.config.WITHDRAWMINFEE + '_INPUT'])"
                       class="link">更新</a>
                </td>
                <td>
                    <span class="text" style="margin-right: 5px;">{{vm.coinListMap[item.assetCode][vm.config.WITHDRAWMIN]}}</span>
                    <input type="number"
                           style="width: 80px;"
                           ng-model="vm.coinListMap[item.assetCode][vm.config.WITHDRAWMIN + '_INPUT']"
                           class="form-control coin-input">
                    <a href="javascript:;"
                       ng-click="vm.update(item.assetCode, vm.config.WITHDRAWMIN, vm.coinListMap[item.assetCode][vm.config.WITHDRAWMIN + '_INPUT'])"
                       class="link">更新</a>
                </td>
                <td>
                    <span class="text" style="margin-right: 5px;">{{vm.coinListMap[item.assetCode][vm.config.WITHDRAWMAX]}}</span>
                    <input type="number"
                           style="width: 80px;"
                           ng-model="vm.coinListMap[item.assetCode][vm.config.WITHDRAWMAX + '_INPUT']"
                           class="form-control coin-input">
                    <a href="javascript:;"
                       ng-click="vm.update(item.assetCode, vm.config.WITHDRAWMAX, vm.coinListMap[item.assetCode][vm.config.WITHDRAWMAX + '_INPUT'])"
                       class="link">更新</a>
                </td>
                <td>
                    <span class="text" ng-if="vm.coinListMap[item.assetCode].status === 'LISTED'">关闭</span>
                    <span class="text" ng-if="vm.coinListMap[item.assetCode].status === 'INIT'">开启</span>
                    <span class="status-box" ng-if="vm.coinListMap[item.assetCode].status === 'INIT'">
                        <a href="javascript:;"
                           ng-click="vm.updateStatus(item, 'LISTED', '开启')"
                           class="btn btn-success">开启</a>
                        <a href="javascript:;"
                           disabled
                           ng-click="vm.updateStatus(item, 'INIT', '关闭')"
                           class="btn btn-default">关闭</a>
                    </span>
                    <span class="status-box" ng-if="vm.coinListMap[item.assetCode].status === 'LISTED'">
                        <a href="javascript:;"
                           disabled
                           ng-click="vm.updateStatus(item, 'LISTED', '开启')"
                           class="btn btn-success">开启</a>
                        <a href="javascript:;"
                           ng-click="vm.updateStatus(item, 'INIT', '关闭')"
                           class="btn btn-default">关闭</a>
                    </span>
                </td>
            </tr>
            <tr class="ui-loading" ng-if="vm.isLoading === true">
                <td colspan="9">正在加载，请稍候...</td>
            </tr>
            </tbody>
        </table>
    </div>

    <div class="ui-box">
        <div class="form-container">
            <div class="body-title">提币每日限额</div>
            <p>说明：</p>
            <p>1、设置为"-1"，表示禁止转出</p>
            <p>2、设置为"0"，表示转出数量无限制</p>
            <p>3、设置为正整数，表示限制该币种的数量</p>
            <table class="ui-table table table-bordered">
                <tr class="tr">
                    <th width="10%"></th>
                    <th width="30%">level0</th>
                    <th width="30%">level1</th>
                    <th width="30%">level2</th>
                </tr>
                <tr class="tr" ng-repeat="assets in $root.$coinList">
                    <td class="td-title">{{assets.label}}</td>
                    <td class="td"  ng-repeat="item in vm.levels" >
                        <div ng-if="vm['limitList_level'+item][assets.value].isEdit===false">
                            <span class="text" ng-if="vm['limitList_level'+item][assets.value].limit==='0'">不限制</span>
                            <span class="text" ng-if="vm['limitList_level'+item][assets.value].limit==='-1' || vm['limitList_level'+item][assets.value].limit===null">禁止转出</span>
                            <span class="text" ng-if="+vm['limitList_level'+item][assets.value].limit>0">{{vm['limitList_level'+item][assets.value].limit}}</span>
                            <span class="text--edit glyphicon glyphicon-edit" ng-click="vm['limitList_level'+item][assets.value].isEdit=true"></span>
                        </div>
                        <span  ng-if="vm['limitList_level'+item][assets.value].isEdit===true">
                                <input type="number"
                                       ng-model="vm['limitList_level'+item][assets.value].update"
                                       class="form-control">
                                <a href="javascript:;" class="link" ng-click="vm['limitList_level'+item][assets.value].update=-1">禁止转出</a>
                                <a href="javascript:;" class="link" ng-click="vm['limitList_level'+item][assets.value].update=0">不限制</a>
                                <a href="javascript:;" class="link"
                                   ng-click="vm.updateLimitByLevel(assets.value,vm['limitList_level'+item][assets.value].update,item)"
                                   style="color: red">
                                    更新</a>
                                <a href="javascript:;" class="link"
                                   ng-click="vm['limitList_level'+item][assets.value].isEdit=false"
                                   style="color: #2435c7">取消</a>
                            </span>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</div>
</div>
